<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html>
<html>
<head>
	<s:include value="common/header.jsp"></s:include>
	<script type="text/javascript" src="./js/ajax.js"></script>
</head>
<script type="text/javascript">
	$(function() {
		$('#testRetModel').click(function(){
			var UserInfo = {};
			var userList = [];
			UserInfo = {'UserInfo.id': $('#id').val(), 'UserInfo.signId': $('#signId').val(),
					'UserInfo.password': $('#password').val(), 'UserInfo.userId': $('#userId').val(),
					'UserInfo.email': $('#email').val(), 'UserInfo.name': $('#name').val(),
					'UserInfo.address': $('#address').val()
					};
			for(var i=0; i < 5; i++) {
				userList[i] = UserInfo;
			}
			var param2 = {'userList': userList};
			$.post('json/testRetModel!testRetModelList.do', param2, function(obj){
				console.log(obj);
			});
		});
		
		$('#testRet').click(function() {
			var formObj = document.getElementById('testform');
			var result = submitForm(formObj);
			console.log(result);
		});
	});
</script>
<body>		
	<div>
		<s:form id="testform" action="testRetModel!testPost.do">
			<input type="text" id="id" name="user[0].id">
			<input type="text" id="signId" name="user[0].signId">
			<input type="text" id="password" name="user[0].password">
			<input type="text" id="userId" name="user[0].userId">
			<input type="text" id="email" name="user[0].email">
			<input type="text" id="name" name="user[0].name">
			<input type="text" id="address" name="user[0].address">
	<!-- 		<button id="testRetModel">test</button> -->
		</s:form>
		<button id="testRet">test</button>
	</div>
</body>
</html>		